const { defineConfig } = require("@vue/cli-service");
const AutoImport = require("unplugin-auto-import/webpack");
const Components = require("unplugin-vue-components/webpack");
const { TDesignResolver } = require("unplugin-vue-components/resolvers");
module.exports = defineConfig({
  transpileDependencies: true,
  publicPath:'/kuangcai',
  pages: {
    index: {
      entry: "src/main.ts",
      title: "狂采",
    },
  },
  devServer:{
    headers: {
      "Access-Control-Allow-Origin": "*",
    },
    allowedHosts: "all",
    port: 3300,
    proxy: {
      [process.env.VUE_APP_BASE_API]: {
        target: `${process.env.VUE_APP_BASE_PATH}:${process.env.VUE_APP_SERVER_PORT}`,
        changeOrigin: true,
      },
    },
    host: "0.0.0.0",
  },
  configureWebpack: {
    externals: {
      vue: "Vue",
      "mapbox-gl": "mapboxgl",
      "weixin-js-sdk":'wx',
    },
    plugins: [
      AutoImport({
        resolvers: [
          TDesignResolver({
            library: "mobile-vue",
            // library: 'vue-next'
          }),
        ],
      }),
      Components({
        resolvers: [
          TDesignResolver({
            library: "mobile-vue",
            // library: 'vue-next'
          }),
        ],
      })
    ],
  },
});
